package gui.clock;

import javax.swing.BoxLayout;
import javax.swing.JPanel;

public class ClockDisplay extends JPanel {
  private static final long serialVersionUID = -8226532643778621547L;
  private DateTimePanel pnlDateTime;  
  private AbstractClock clock;
  
  public ClockDisplay() {
    super();
    setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));    
    pnlDateTime = new DateTimePanel();
    add(pnlDateTime);
  }
  
  public void setClockType(AbstractClock clock) {
    this.clock = clock;
  }
  
  public void adjustDisplayRate(int newRate) {
    clock.adjustDisplayRate(newRate);
  }
  
  public void reset() {
    pnlDateTime.reset();
  }
  
  public void increment(long milliSecs) {
    pnlDateTime.increment(milliSecs);
  }
  
  public long getTime() {
    return pnlDateTime.getTime();
  }
  
}
